import {mapState, mapGetters, mapActions, mapMutations} from 'vuex'
import { MODAL, TAB, TOOLS, CONTENT } from './mutations-types/outreach-group'

export const someComputed = {
  ...mapState('some', {
    currentUser: (state) => state.currentUser
  }),
  ...mapGetters('some', ['constants'])
}

export const someMethods = mapActions('some', ['action1', 'action2'])

export const outreachGroupComputed = {
  ...mapState('oGModal', {
    isShow: (state) => state.isShow,
    name: (state) => state.name,
    title: (state) => state.title,
    maxLength: (state) => state.maxLength,
    useType: (state) => state.useType,
    modalType: (state) => state.modalType,
    mobile: (state) => state.mobile
  }),
  ...mapState('oGTools', {
    showTools: (state) => state.isShow,
    x: (state) => state.x,
    y: (state) => state.y
  }),
  ...mapState('oGTab', {
    groupList: (state) => state.groupList,
    isLastDepartment: (state) => state.isLastDepartment
  }),
  ...mapState('oGContent', {
    staffList: (state) => state.staffList
  })
}

export const outreachGroupMethods = {
  ...mapMutations('oGModal', [
    MODAL.SHOW_MODAL,
    MODAL.SET_NAME,
    MODAL.SUBMIT,
    MODAL.CANCEL,
    MODAL.SET_MOBILE
  ]),
  ...mapMutations('oGTools', [
    TOOLS.SET_POSITION,
    TOOLS.SHOW_TOOLS,
    TOOLS.UPDATE_IS_ENTER
  ]),
  ...mapMutations('oGTab', [
    TAB.SET_ADD_POSITION,
    TAB.SET_DEL_POSITION,
    TAB.SET_EDIT_POSITION,
    TAB.SET_MOVE_POSITION
  ]),
  ...mapActions('oGTab', [
    'addDepartment',
    'changeTab',
    'deleteDepartment',
    'editDepartment',
    'moveDepartment'
  ]),
  ...mapMutations('oGContent', [
    CONTENT.SET_CURRENT_STAFF
  ]),
  ...mapActions('oGContent', [
    'reqStaffList',
    'addStaff',
    'editorStaff'
  ])
}
